# # _*_coding:utf-8_*_
# import time
# def consumer(name):
#     print("%s准备吃包子了"%name)
#     while True:
#         baozi = yield
#         print("包子%s来了，被%s吃了"%(baozi,name))
#
#
# def prodect(name):
#     c = consumer('A')
#     c2 = consumer('B')
#     c.__next__()
#     c2.__next__()
#     print('老子开始准备包子了')
#     for i in range(10):
#         time.sleep(1)
#         print('做了两个包子')
#         c.send(i)
#         c2.send(i)
#
# prodect('alex')
#
#
#
#
#
#
#










import time
def consumer(name):
    print('%s准备吃包子了'%name)
    while True:
        baozi = yield
        print('包子%s来了，被%s吃了'%(baozi,name))

def prodect(name):
    c1 = consumer('A')
    c2 = consumer('B')
    c1.__next__()
    c2.__next__()
    print("老子开始生产包子了")
    for i in range(5):
        time.sleep(1)
        print('做了两个包子')
        c1.send(i)
        c2.send(i)
prodect('alex')